/*
 * @Description: 动态数组
 * @Version: 1.0
 * @Author: marshal
 * @Date: 2022-06-11 18:18:05
 * @LastEditors: marshal
 * @LastEditTime: 2022-07-01 14:10:28
 */
#include <stdio.h>
#include <stdlib.h>

#define SIZE 10

int main()
{
    // malloc memory
    int *nums = (int *)malloc(SIZE * sizeof(int));
    int i;
    for (i = 0; i < SIZE; i++)
    {
        nums[i] = i * i;
    }

    // print element of nums use pointers
    for (i = 0; i < SIZE; i++)
    {
        printf("address of nums[%d] : %p\n", i, nums);
        printf("value of nums[%d] : %d\n", i, *nums);
        nums++;
    }
    // free(nums);
    return 0;
}